In [1]:
%matplotlib inline

Run the file


In [2]:
%run eqsimparsing.py


Will only parse out the reports as needed, no weather normalization done, this is an AMY case
Loading .\Example.SIM
Unmet Cooling Hours: 9
Unmet Heating Hours: 40
In an interactive prompt, the variables 'usage', 'sv_a_dict', 'pv_a_dict' are initialized

Example of how to manipulate the objects in IPython

Note that the script does also output PV-A and SV-A to a csv file already

I'm importing seaborn because I like it, but this is just plot styling... feel free to delete this following cell


In [3]:
import seaborn as sns
sns.set(style="white", context="talk")

pv_a_dict and sv_a_dict are dictionaries where the values are Pandas dataframes


In [4]:
pv_a_dict.keys()


Out[4]:
dict_keys(['BOILERS', 'CIRCULATION LOOPS', 'CHILLERS', 'DW-HEATERS', 'PUMPS', 'COOLING TOWERS'])

In [5]:
type(pv_a_dict['CHILLERS'])


Out[5]:
pandas.core.frame.DataFrame

In [6]:
pv_a_dict['PUMPS']


Out[6]:
Attached to Flow (GPM) Head (ft) Head Setpoint (ft) Capacity Control Power (kW) Mech. Eff Motor Eff W/GPM
Pump
WSHP Pump WSHP Loop 509.8 79.9 42.6 STAGED 11.200 0.77 0.89 21.969400
CT Pump Cooling Tower 526.6 38.7 0.0 ONE-SPEED 5.600 0.77 0.89 10.634258
BP-2 Heating Boiler 2 83.5 6.0 0.0 ONE-SPEED 0.191 0.77 0.64 2.287425
BP-1 Heating Boiler 1 235.6 15.5 0.0 ONE-SPEED 1.120 0.77 0.80 4.753820
DHW Pump 1 DHW Boiler 1 10.0 7.7 0.0 ONE-SPEED 0.047 0.77 0.40 4.700000
DHW Pump 2 DHW Boiler 2 10.0 7.7 0.0 ONE-SPEED 0.047 0.77 0.40 4.700000

In [7]:
pv_a_dict['PUMPS'].ix[:, 'W/GPM'].plot(kind='bar', figsize=(16,9), title='Pump W/GPM', color='#EB969C',);
sns.despine()
plt.show();



In [8]:
pv_a_dict['BOILERS']


Out[8]:
Equipment Type Attached to Capacity (mmBTU/hr) Flow (GPM) EIR HIR Aux. (kW) Thermal Eff
Primary Equipment
Heating Boiler 1 HW-BOILER WSHP Loop -0.327 91.0 0 1.266 0 0.789889
Heating Boiler 2 HW-BOILER WSHP Loop -0.300 83.5 0 1.266 0 0.789889

In [9]:
sv_a_dict['Fans'].ix[:,'W/CFM'].plot(kind='barh', figsize=(12,10), color='#EB969C', title='Fan W/CFM')
sns.despine()
plt.show();



In [10]:
sv_a_dict.keys()


Out[10]:
dict_keys(['Systems', 'Zones', 'Fans'])

In [11]:
sys = sv_a_dict['Systems']
sys.head()


Out[11]:
System Type Altitude Factor Floor Area (sqft) Max People Outside Air Ratio Cooling Capacity (kBTU/hr) Sensible (SHR) Heating Capacity (kBTU/hr) Cooling EIR (BTU/BTU) Heating EIR (BTU/BTU) Heat Pump Supplemental Heat (kBTU/hr)
System
Hallway System - MASTER CA SYS PVVT 1 2724.5 3 0 172.432 0.709 -208.729 0.269 0.24 0
HP for Office 3rd Floor PVVT 1 327.9 2 0 17.649 0.729 -21.365 0.269 0.24 0
HP Above Lobby Sys PVVT 1 227.3 1 0 25.441 0.71 -30.797 0.269 0.24 0
HP Conf/TV Sys PVVT 1 1619.7 81 0 173.163 0.704 -209.614 0.269 0.24 0
HP Above Kit Sys PVVT 1 1500.8 31 0 165.764 0.692 -200.658 0.269 0.24 0

In [ ]:


In [12]:
# Calculating Max People/sqft
sys['Max People/sqft'] = sys['Max People'] / sys['Floor Area (sqft)']

In [13]:
# Sorting and returning top 10
sys.sort_values(by='Max People/sqft', ascending=False).head(10)


Out[13]:
System Type Altitude Factor Floor Area (sqft) Max People Outside Air Ratio Cooling Capacity (kBTU/hr) Sensible (SHR) Heating Capacity (kBTU/hr) Cooling EIR (BTU/BTU) Heating EIR (BTU/BTU) Heat Pump Supplemental Heat (kBTU/hr) Max People/sqft
System
HP Conf/TV Sys PVVT 1 1619.7 81 0 173.163 0.704 -209.614 0.269 0.24 0 0.0500093
HP Above Kit Sys PVVT 1 1500.8 31 0 165.764 0.692 -200.658 0.269 0.24 0 0.0206557
B-APT-07 Zn-Sys PVVT 1 224.4 3 0 13.268 0.718 -16.06 0.269 0.24 0 0.013369
B-APT-08 Zn MASTER SYS PVVT 1 233.7 3 0 12.58 0.707 -15.228 0.269 0.24 0 0.012837
2-APT-05 Zn-Sys PVVT 1 249.9 3 0 20.339 0.715 -24.621 0.269 0.24 0 0.0120048
4-APT-05 Zn-Sys PVVT 1 249.9 3 0 12.934 0.729 -15.656 0.269 0.24 0 0.0120048
3-APT-05 Zn-Sys PVVT 1 249.9 3 0 13.111 0.719 -15.871 0.269 0.24 0 0.0120048
3-APT-01 Zn-Sys PVVT 1 275.9 3 0 15.671 0.725 -18.969 0.269 0.24 0 0.0108735
B-APT-06 Zn-Sys PVVT 1 309.7 3 0 16.23 0.712 -19.646 0.269 0.24 0 0.00968679
4-APT-03 Zn-Sys PVVT 1 325.2 3 0 16.65 0.73 -20.155 0.269 0.24 0 0.00922509

In [14]:
zones = sv_a_dict['Zones']
zones.head(10)


Out[14]:
Supply Flow (CFM) Exhaust Flow (CFM) Fan (kW) Minimum Flow (Frac) Outside Air Flow (CFM) Cooling Capacity (kBTU/hr) Sensible (FRAC) Extract Rate (kBTU/hr) Heating Capacity (kBTU/hr) Addition Rate (kBTU/hr) Zone Mult W/CFM
System Zone Name
Hallway System - MASTER CA SYS 2-HALLWAY-2 Zn 400 0 0 1 0 0 0 9.94 0 -13.40 1 0
B-HALLWAY Zn 724 0 0 1 0 0 0 17.99 0 -24.25 1 0
1-HALLWAY-1 Zn 270 0 0 1 0 0 0 6.69 0 -9.02 1 0
1-HALLWAY-2 Zn 1185 0 0 1 0 0 0 29.45 0 -39.69 1 0
2-HALLWAY-1 Zn 995 0 0 1 0 0 0 24.71 0 -33.31 1 0
2-ELEV-ROOM Zn 53 0 0 1 0 0 0 1.31 0 -1.77 1 0
3-HALLWAY-2 Zn 680 0 0 1 0 0 0 16.90 0 -22.77 1 0
3-HALLWAY-1 Zn 31 0 0 1 0 0 0 0.77 0 -1.03 1 0
4-HALLWAY Zn 770 0 0 1 0 0 0 19.13 0 -25.78 1 0
HP for Office 3rd Floor 3-OFFICE-Zn 548 0 0 1 0 0 0 13.61 0 -18.34 1 0

Group by system and apply

Example on aggregating zones to the system level


In [15]:
def custom_apply_zones(x):
    """ Aggregate zone data to the system level
    
    For the zones, some columns should be summed (CFM, Capacity, etc)
    But others should be averaged
    """
    # For these three columns, do a mean
    if x.name in ['Minimum Flow (Frac)', 'Sensible (FRAC)', 'W/CFM']:
        return np.mean(x)
    # For the rest, do a sum
    else:
        return np.sum(x)

In [16]:
# After the groupby, the apply applies to each group dataframe. So I use a lambda x to apply to each column
zones_agg_metrics = zones.groupby(level='System').apply(lambda x: x.apply(custom_apply_zones))
# Recalc a weighted W/CFM
zones_agg_metrics['W/CFM'] = zones_agg_metrics['Fan (kW)'] * 1000 / zones_agg_metrics['Supply Flow (CFM)']

zones_agg_metrics.head()


Out[16]:
Supply Flow (CFM) Exhaust Flow (CFM) Fan (kW) Minimum Flow (Frac) Outside Air Flow (CFM) Cooling Capacity (kBTU/hr) Sensible (FRAC) Extract Rate (kBTU/hr) Heating Capacity (kBTU/hr) Addition Rate (kBTU/hr) Zone Mult W/CFM
System
Hallway System - MASTER CA SYS 5108 0 0 1 0 0 0 126.89 0 -171.02 9 0
HP for Office 3rd Floor 548 0 0 1 0 0 0 13.61 0 -18.34 1 0
HP Above Lobby Sys 755 0 0 1 0 0 0 18.76 0 -25.29 4 0
HP Conf/TV Sys 5069 0 0 1 0 0 0 125.91 0 -169.70 2 0
HP Above Kit Sys 4708 0 0 1 0 0 0 116.94 0 -157.62 2 0

In [17]:
fans = sv_a_dict['Fans']

In [18]:
fans


Out[18]:
Capacity (CFM) Diversity Factor (FRAC) Power Demand (kW) Fan deltaT (F) Static Pressure (in w.c.) Total efficiency Mechanical Efficiency Fan Placement Fan Control Max Fan Ratio (Frac) Min Fan Ratio (Frac) W/CFM
System Fan Type
Hallway System - MASTER CA SYS SUPPLY 5108 1 1.533 0.93 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.300117
HP for Office 3rd Floor SUPPLY 548 1 0.164 0.93 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.299270
HP Above Lobby Sys SUPPLY 756 1 0.227 0.93 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.300265
HP Conf/TV Sys SUPPLY 5069 1 1.521 0.93 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.300059
HP Above Kit Sys SUPPLY 4708 1 1.412 0.93 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.299915
HP 1 Base Sys SUPPLY 950 1 0.285 0.93 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.300000
HP 2 Base Sys SUPPLY 776 1 0.233 0.93 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.300258
B-APT-08 Zn MASTER SYS SUPPLY 371 1 0.100 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269542
4-APT-05 Zn-Sys SUPPLY 401 1 0.108 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269327
4-APT-02 Zn-Sys SUPPLY 628 1 0.170 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270701
4-APT-06 Zn-Sys SUPPLY 1006 1 0.272 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270378
B-APT-01 Zn-Sys SUPPLY 654 1 0.177 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270642
B-APT-07 Zn-Sys SUPPLY 401 1 0.108 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269327
2-APT-03 Zn-Sys SUPPLY 1680 1 0.454 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270238
B-APT-02 Zn-Sys SUPPLY 585 1 0.158 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270085
B-APT-03 Zn-Sys SUPPLY 728 1 0.197 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270604
B-APT-06 Zn-Sys SUPPLY 485 1 0.131 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270103
4-APT-04 Zn-Sys SUPPLY 698 1 0.189 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270774
2-APT-05 Zn-Sys SUPPLY 612 1 0.165 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269608
2-APT-07 Zn-Sys SUPPLY 1298 1 0.350 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269646
3-APT-02 Zn-Sys SUPPLY 934 1 0.252 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269807
2-APT-06 Zn-Sys SUPPLY 975 1 0.263 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269744
3-APT-05 Zn-Sys SUPPLY 398 1 0.107 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.268844
2-APT-01 Zn-Sys SUPPLY 908 1 0.245 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269824
3-APT-06 Zn-Sys SUPPLY 750 1 0.203 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270667
3-APT-01 Zn-Sys SUPPLY 482 1 0.130 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269710
4-APT-01 Zn-Sys SUPPLY 757 1 0.204 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269485
2-APT-02 Zn-Sys SUPPLY 1031 1 0.278 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269641
3-APT-07 Zn-Sys SUPPLY 777 1 0.210 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270270
4-APT-03 Zn-Sys SUPPLY 518 1 0.140 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270270
3-APT-04 Zn-Sys SUPPLY 565 1 0.153 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270796
4-APT-07 Zn-Sys SUPPLY 690 1 0.186 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269565
3-APT-03 Zn-Sys SUPPLY 556 1 0.150 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269784
2-APT-08 Zn-Sys SUPPLY 807 1 0.218 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270136
B-APT-04 Zn-Sys SUPPLY 664 1 0.179 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.269578
2-APT-04 Zn-Sys SUPPLY 1384 1 0.374 0.83 0 0 0 DRAW-THRU CONSTANT 1 0.3 0.270231
Elev Cooling Sys SUPPLY 586 0 0.000 0.22 0 0 0 BLOW-THRU 2-SPEED 0 0.0 0.000000

Example on adding all system fans' power

The following would add up all system fans (supply, return, relief), then sort it and plot it


In [19]:
fans.groupby(level='System').apply(sum)['Power Demand (kW)'].sort_values(inplace=False).plot(kind='barh',
                                                                figsize=(12,10), color='#EB969C',
                                                                title='System wide fan power demand (kW)')
sns.despine()
plt.show();